<div class="center_content">
	<div class="left_content">
		<ul class="nav nav-list">
			<li class="nav-header">
				<%= t('Category') %>
			</li>
			<% @categories.each do |category| %>
			<li>
				<% if session[:language] == 'vi'%>
					<%= link_to category.name, :controller => 'categories',:action => 'show',:id => category.id%>
				<% else %>
					<%= link_to category.description, :controller => 'categories',:action => 'show',:id => category.id%>
				<% end%>
			</li>
			<% end %>
		</ul>
	</div>

	<div class="right_content">
		<div class="search">
			<%= form_tag search_default_index_path, :method => :get,:class =>"navbar-form pull-left" do %>
				<%= select_tag :search_type, options_for_select(["Author", "Title", "ID Book"]), :class => "input-small search-filter" %>
				<%= text_field_tag :search_value, nil, :class => "search-input" %>
				<div class="search-btn">
					<%= submit_tag t("Search"), :class => 'btn'%>
				</div>
			<% end %>
		</div>
		<% if flash[:message]%>
			<div class="notice">
				<%= flash[:message] %>
			</div>
		<% end %>
		<div class = "listbooks">
		<div id="most_view">
			<div class="category_name">
				<%= t('Most Viewed')%>
			</div>
			<div class="category_content">
				<ul>
					<% @most_views.each do |most_view|%>
					<li>
						<%= link_to (image_tag most_view.image_url),:controller => 'bookDetail',:action =>'show',:id => most_view.id%>
						<br>
						<%= link_to most_view.title,:controller => 'bookDetail',:action =>'show',:id => most_view.id%>
						<br/>
						<% if most_view.current_quantity.to_i > 0%>
						<%= t('Available')%>
						<% else%>
						<%= t('Not Available')%>
						<% end%>
						<br/>
						<%= t('Author')%>: <%= most_view.author%>
					</li>
					<% end %>
				</ul>
			</div>
		</div>

		<div id="most_borrow">
			<div class="category_name">
				<%= t('Most Borrowed')%>
			</div>
			<div class="category_content">
				<ul>
					<% @most_borrows.each do |most_borrow|%>
					<li>
						<%= link_to (image_tag most_borrow.image_url),:controller => 'bookDetail',:action =>'show',:id => most_borrow.id%>
						<br>
						<%= link_to most_borrow.title,:controller => 'bookDetail',:action =>'show',:id => most_borrow.id%>
						<br/>
						<% if most_borrow.current_quantity.to_i > 0%>
						<%= t('Available')%>
						<% else%>
						<%= t('Not Available')%>
						<% end%>
						<br/>
						<%= t('Author')%>: <%= most_borrow.author%>
					</li>
					<% end %>
				</ul>
			</div>
		</div>

		<div id="newbook">
			<div class="category_name">
				<%= t('New Book')%>
			</div>
			<div class="category_content">
				<ul>
					<% @new_books.each do |new_book|%>
					<li>
						<%= link_to (image_tag new_book.image_url),:controller => 'bookDetail',:action =>'show',:id => new_book.id%>
						<br>
						<%= link_to new_book.title,:controller => 'bookDetail',:action =>'show',:id => new_book.id%>
						<br/>
						<% if new_book.current_quantity.to_i > 0%>
						<%= t('Available')%>
						<% else%>
						<%= t('Not Available')%>						
						<% end%>
						<br/>
						<%= t('Author') %> : <%= new_book.author%>
					</li>
					<% end %>
				</ul>
			</div>
		</div>
		</div>
	</div>
</div>
